package com.yfjin.cut;

import android.os.Bundle;
import android.os.Environment;
import android.util.Log;

import java.io.File;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        final File srcFile = new File(Environment.getExternalStorageDirectory(), "music.mp3");
        if (!srcFile.exists()) {
            Log.i("123123", "bucunzai ");
            return;
        }


        final String outPath = Environment.getExternalStorageDirectory().getPath();

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    //10-20秒
                    new MusicProgress().clip(srcFile.getPath(), outPath, 10 * 1000 * 1000, 20 * 1000 * 1000);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }).start();

    }

}